package org.example.mall.admin.model.entity.manage;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 认证类型
 * </p>
 *
 * @author hzq
 * @since 2021-12-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("account_auth")
@ApiModel(value = "AccountAuth对象", description = "认证类型")
public class AccountAuth extends Model<AccountAuth> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @TableId(value = "account_auth_id", type = IdType.AUTO)
    private Integer accountAuthId;

    @ApiModelProperty(value = "用户id")
    @TableField("account_id")
    private Integer accountId;

    @ApiModelProperty(value = "用户全局id")
    @TableField("union_id")
    private String unionId;

    @ApiModelProperty(value = "认证类型")
    @TableField("auth_type")
    private String authType;

    @ApiModelProperty(value = "标识")
    @TableField("principal")
    private String principal;

    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    @ApiModelProperty(value = "凭证")
    @TableField("credentials")
    private String credentials;

    @ApiModelProperty(value = "扩展")
    @TableField("expand")
    private String expand;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "版本")
    @TableField("version")
    @Version
    private Integer version;


    @Override
    protected Serializable pkVal() {
        return this.accountAuthId;
    }

}
